package luogu;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = 0;
        int b= 0;
        int c= 0;
        int d= 0;
        if (x%2==0&&x>4&&x<=12){
            a = 1;
        } else {
            a = 0;
        }

        if (x%2==0||(x>4&&x<=12)){
            b = 1;
        }else {
            b =0;
        }

        if ((x%2==0 && !(x>4 && x<=12)) || (x%2==1 && (x>4 && x<=12))){
            c = 1;
        }else {
            c = 0;
        }

        if ((x<=4||x>12)&&x%2==1) {
            d = 1;
        }else {
            d = 0;
        }

        System.out.println(a+" "+b+" "+c+" "+d);
    }
}
